package org.gwt.pluginframework.common;

import org.gwt.pluginframework.common.exception.NoSuchPluginException;
import org.gwt.pluginframework.common.exception.RegistrationException;

/**
 * Interface represents plug-in register responsibilities for plug-in manager.
 * 
 * @author mszymanski
 */
public interface IPluginsRegister {
	/**
	 * Registers plug-in which will be default started.
	 * 
	 * @param plugin
	 * @throws RegistrationException
	 */
	void registerPlugin(IPlugin plugin) throws RegistrationException;

	/**
	 * Registers plug-in which will be started if start is true.
	 * 
	 * @param plugin
	 * @param start
	 * @throws RegistrationException
	 */
	void registerPlugin(IPlugin plugin, boolean start)
			throws RegistrationException;

	/**
	 * Unregisters provided plug-in.
	 * 
	 * @param plugin
	 */
	void unregisterPlugin(IPlugin plugin);
	
	/**
	 * Provides plug-in by name.
	 * 
	 * @param name
	 * @return
	 * @throws NoSuchPluginException
	 */
	IPlugin getPlugin(String name) throws NoSuchPluginException;
}
